﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="GradeBook.Daos" %>
<%@ Import Namespace="GradeBook.Security" %>
<%
    if (Request.IsAuthenticated) {
%>
        Добро пожаловать, <b><%= Html.Encode(MemShPrvd.CurrUser().FirstName + " " + MemShPrvd.CurrUser().LastName)%></b>!<br/>
        <% if (HttpContext.Current.User.IsInRole("STUDENT"))
           { %>
        Группа: <b><%=
                   Html.Encode(GroupDao.GetById((int) MemShPrvd.CurrUser().GroupId).Name) %></b> <br/>
        <% } %>
        [ <%: Html.ActionLink("Выйти", "LogOff", "Account") %> ]
<%
    }
    else {
%> 
        [ <%: Html.ActionLink("Вход", "LogOn", "Account") %> ]
<%
    }
%>